from flask import jsonify
from flask_restful import Resource, reqparse


class login(Resource):

    def post(self):
        parser = reqparse.RequestParser()
        parser.add_argument('account', type=str, required=True, help='account错误.')
        parser.add_argument('password', type=str, required=True, help='password错误.')
        args = parser.parse_args()
        if args.account == 'admin':
            return jsonify({'err': '0', 'msg': '成功' })
        else:
            return jsonify({'err': '1', 'msg': '失败' })


